import axios from 'axios';
let request = axios.create()

//获取栏目头部
export const getNavList = () => request({url:'http://127.0.0.1:3000/api/Stu/showStu',method:'get'})


//添加栏目   http://localhost:3000/api/Stu/addStu    post     http://localhost:3000/api/Stu/addStu?cs_id=18&channel=好好的
export const addNav = (cs_id,channel) => request({url:`http://127.0.0.1:3000/api/Stu/addStu?cs_id=${cs_id}&channel=${channel}`,method:'post'})

//修改栏目   http://localhost:3000/api/Stu/updateStu   post      http://localhost:3000/api/Stu/updateStu?id=22&cs_id=19&channel=感觉还还
export const alterNav = (id,cs_id,channel) => request({url:`http://localhost:3000/api/Stu/updateStu?id=${id}&cs_id=${cs_id}&channel=${channel}`,method:'post'})

//删除栏目   http://localhost:3000/api/Stu/delStu  delete   http://localhost:3000/api/Stu/delStu?id=22
export const deleteNav = (id) => request({url:`http://localhost:3000/api/Stu/delStu?id=${id}`,method:'delete'})

//测试
export const asa = () => request({url:'http://localhost:3000/api/message/showmessage',method:'get'})